using Admin.NET.Core;
using MOKA.TPM.Entity;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （物料库存变动历史）
/// </summary>
public class PartsStockChangeOutput : PartsStockChange
{
    /// <summary>
    /// 操作模块 （字典名称）
    /// </summary>
    public string? ChgTypeName { get; set; }

    /// <summary>
    /// 操作类型 （字典名称）
    /// </summary>
    public string? TypeName { get; set; }

    /// <summary>
    /// 车间 （字典名称）
    /// </summary>
    public string? WorkshopName { get; set; }

    /// <summary>
    /// 仓位 （字典名称）
    /// </summary>
    public string? LocationName { get; set; }

    /// <summary>
    /// 领用产线 （字典名称）
    /// </summary>
    public string? ToLineName { get; set; }

    /// <summary>
    /// 关联对象等
    /// </summary>
    //public string? WePartyLevelName { get; set; }
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class PartsStockChangeInput
{
    /// <summary>
    /// </summary>
    public long? Id { get; set; }
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetPartsStockChangeInput : BaseOrderInput
{
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PagePartsStockChangeInput : BasePageInput
{
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddPartsStockChangeInput
{
    /// <summary>
    /// 物料编码
    /// </summary>
    [Required, MaxLength(50)]
    public string PartNo { get; set; } = string.Empty;

    /// <summary>
    /// 操作时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 单据号
    /// </summary>
    [Required, MaxLength(50)]
    public string BillNo { get; set; } = string.Empty;

    /// <summary>
    /// 操作模块
    /// </summary>
    public Guid ChgType { get; set; }

    /// <summary>
    /// 操作类型
    /// </summary>
    public Guid Type { get; set; }

    /// <summary>
    /// 车间
    /// </summary>
    public Guid Workshop { get; set; }

    /// <summary>
    /// 仓位
    /// </summary>
    public Guid Location { get; set; }

    /// <summary>
    /// 旧库存
    /// </summary>
    public decimal StoreQtyChanging { get; set; }

    /// <summary>
    /// 数量
    /// </summary>
    public decimal Num { get; set; }

    /// <summary>
    /// 批次号
    /// </summary>
    [MaxLength(10)]
    public string? BatchNumber { get; set; }

    /// <summary>
    /// 新库存
    /// </summary>
    public decimal StoreQtyChanged { get; set; }

    /// <summary>
    /// 领用产线
    /// </summary>
    public Guid? ToLine { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// 操作人
    /// </summary>
    [Required, MaxLength(20)]
    public string CreateUser { get; set; } = string.Empty;

    /// <summary>
    /// 确认时间
    /// </summary>
    public DateTime? ConTime { get; set; }
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdatePartsStockChangeInput
{
    /// <summary>
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 物料编码
    /// </summary>
    [MaxLength(50)]
    public string PartNo { get; set; }

    /// <summary>
    /// 操作时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 单据号
    /// </summary>
    [MaxLength(50)]
    public string BillNo { get; set; }

    /// <summary>
    /// 操作模块
    /// </summary>
    public Guid ChgType { get; set; }

    /// <summary>
    /// 操作类型
    /// </summary>
    public Guid Type { get; set; }

    /// <summary>
    /// 车间
    /// </summary>
    public Guid Workshop { get; set; }

    /// <summary>
    /// 仓位
    /// </summary>
    public Guid Location { get; set; }

    /// <summary>
    /// 旧库存
    /// </summary>
    public decimal StoreQtyChanging { get; set; }

    /// <summary>
    /// 数量
    /// </summary>
    public decimal Num { get; set; }

    /// <summary>
    /// 批次号
    /// </summary>
    [MaxLength(10)]
    public string? BatchNumber { get; set; }

    /// <summary>
    /// 新库存
    /// </summary>
    public decimal StoreQtyChanged { get; set; }

    /// <summary>
    /// 领用产线
    /// </summary>
    public Guid? ToLine { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// 操作人
    /// </summary>
    [MaxLength(20)]
    public string CreateUser { get; set; }

    /// <summary>
    /// 确认时间
    /// </summary>
    public DateTime? ConTime { get; set; }
}

/// <summary>
/// 删除参数
/// </summary>
public class DeletePartsStockChangeInput
{
    /// <summary>
    /// </summary>
    public long Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomePartsStockChangeInput
{
    /// <summary>
    /// </summary>
    public long Id { get; set; }
}